package vn.muzik.action;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public abstract class BaseAction extends ActionSupport implements ApplicationContextAware{
    protected ApplicationContext ctx;
    
    @PostConstruct
    public abstract void initAction() throws Exception;
    
    @Override
    public void setApplicationContext(ApplicationContext arg0)
            throws BeansException {
        this.ctx = arg0;
    }

    @PreDestroy
    public abstract void destroy() throws Exception;
}
